-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] 55 restructure simulation api for do step #65
Draft
KBeeser
wants to merge
62
commits into
master
Choose a base branch
from
55-restructure-simulation-api-for-do_step
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KBeeser
commented
Sep 18, 2022
•
edited
Loading
edited
- Code sections that require deeper rewiev are labeled "todo: review"
do_step reads FMU values, applies inputs and performs a single simulation step. the initialiszation function allows to set parameters and initial values and must be called before performing simulation steps
in order to find index in df instead of bisection implemenation the pandas get_indexer() method is used. Instead of holding the last available value, linear interpolation can be used
results attribut is directly filled by do_step_read_write function; tsd is replaced by pandas df; a get_results_function is added returning the results (and converting them to tsd if needed)
…ts by default Because this is the typical case in a do_step_simulation
function to find variables starting with a certain str; helpful for example to filter for bus variables
get rid of read_write_step function, because usually there is communication between read and write; Introduce read_variables wrapper function that appends the results to the sim_res frame by default; Introduce set_variables wrapper function, that uses a table and/or a dict as input. After writing the variables, optionally it calls the do_step function; the status indicator finished from the do_step function is an attribute now; the do_step function closes the fmu, if finished; the get_results function checks for duplicates in the sim_res frame
demonstration of step wise fmu simulation. Apllication is a control task. First the system fmu interacts with a python controller, second the system fmu interacts with a second controller fmu
can be set in the initialize() func. But can also be adjusted during stepwise simulation using setter
… it can be reinitialized easily
different philosophy: User-friendly do_step wrapper function makes explicti call of read/set_vars functions unecessary. The do_step wrapper sets the vars given as arguments to the fmu, performs a simulation step and after the step reads the results and appends them to the results dataframe
…ithub.com/RWTH-EBC/ebcpy into 55-restructure-simulation-api-for-do_step start restructuring from 38 do_step branch
…n-class use of pydantic to integrate config file
path fmu_discrete_simulation(Model,FMU) is running
…ound truth added log messages related to discrete FMU simulation
adjsut examples to include experiment configuration
…ds; class method that prints available experiment configuration fields
…and readability in overall simulation api class structure
…ined in sub-class but used in super class
…api-for-do_step # Conflicts: # ebcpy/simulationapi/__init__.py # ebcpy/simulationapi/dymola.py # ebcpy/simulationapi/fmu.py # examples/e2a_fmu_continuous_example.py # examples/e3_dymola_example.py # tests/test_simulationapi.py resolve merge conflict by selecting the according files in 55-restructure-simulation-api-for-do_step
Merge master in #55
FelixStege
requested changes
Oct 17, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the great work @konrad234!
I added some comments. Mainly:
- There are a lot of result/simulation files which are not needed and can be deleted
- The unittests are currently not running properly
- There are quite a few TODO markers in the code
also consider kwargs (#64) and use default log message within the examples to avoid user interaction to avoid proplems in dynamic testing.
…e to the results in order to get rid of current_time attribute in FMU class
…right after modifying input_table or sim_setup attributes. this improves efficiency, as this check can make interpolation obsolete. Befere this check was performed every simulation step, which is less efficient
given a key, the initialization arguments of the simulation apis also run with the outdated arguments insted of the configuration.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.